﻿<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>三3三博客社区</title>
    <link rel="icon" href="../../../images/icon.jpg" sizes="32x32">

<link rel="stylesheet" href="css/smusic.css">

</head>
<body>

<div class="grid-music-container f-usn">
    <div id="musicImg"></div>
    <div class="m-music-play-wrap">
        <div class="u-cover"></div>
        <div class="m-now-info">
            <h1 class="u-music-title"><small>...</small><small>...</small></h1>
            <div class="m-now-controls">
                <div class="u-control u-process">
                    <span class="buffer-process"></span>
                    <span class="current-process"></span>
                </div>
                <div class="u-control u-time">00:00/00:00</div>
                <div class="u-control u-volume">
                    <div class="volume-process" data-volume="0.50">
                        <span class="volume-current"></span>
                        <span class="volume-bar"></span>
                        <span class="volume-event"></span>
                    </div>
                    <a class="volume-control"></a>
                </div>
            </div>
            <div class="m-play-controls">
                <a class="u-play-btn prev" onclick="reload()" title="上一曲"></a>
                <a class="u-play-btn ctrl-play play" title="暂停"></a>
                <a class="u-play-btn next" title="下一曲" onclick="reload()"></a><br>
               
            </div>
        </div>
    </div>
    <div class="f-cb">&nbsp;</div>
    <div class="m-music-list-wrap"></div>
</div>

<script src="js/smusic.min.js"></script>
<script src="/assets/jquery.min.js"></script>
<script>
var musicList = [
	{
		title : '衡越',
		singer : '圆梦',
		cover  : '',
		src    : 'mp3/10714.mp3'
	}
];
// new SMusic({
// 	musicList:musicList
// });

$(function () {
    reload();
})

    function reload() {
        $.ajax({
                type: 'POST',
                url:"/misc/searchMusic",
                contentType: "application/json",
                success: function (data) {
                    if (data.code == 200){
                        let data1 = data.data;
                        var music = {
                            title: data1.name,
                            singer: data1.artistsname,
                            cover: '',
                            src: data1.url
                        }
                        musicList.push(music);
                        console.log(musicList)
                        $("#musicImg").append('<img title='+data1.title+' src='+data1.picurl+'>')
                        new SMusic({
                            musicList:musicList
                        });
                    }else {
                        alert(data.data)
                    }
                }
            }
        )
    }
</script>

</div>
</body>
</html>